package Tool;

public class intArrayTool {
    public static String intArrayToString(int [] array){
        String resultString = "";
        for(int i = 0 ; i < array.length; i ++){
            resultString += array[i];
        }
        return resultString;
    }
    //比较两个数组的值是否完全一样
    //两个数组的长度要相等
    public static boolean isSame(int [] arrayOne,int [] arrayTwo){
        boolean result = false;
        if(arrayOne.length != arrayTwo.length) return result;
        String one = "";
        String two = "";
        for(int i = 0 ; i < arrayOne.length; i ++){
            one += arrayOne[i];
            two += arrayTwo[i];
        }
        if (one.equals(two)) result = true;
        return result;
    }
    //检查数组中是否含有指定数字
    public static boolean isHasSome(int [] array, int some){
        boolean isHas = false;  //缺省不含有
        for(int i = 0; i < array.length; i ++){
            if(array[i] == some) {
                isHas = true;
                break;
            }
        }
        return isHas;
    }
}
